<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/cardView"
        app:cardElevation="0dp"
        app:cardBackgroundColor="@color/app_background"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:elevation="10dp"
            android:paddingStart="10dp"
            android:paddingEnd="10dp"
            android:paddingTop="14dp"
            android:paddingBottom="14dp"
            android:id="@+id/searchLayout"
            android:orientation="horizontal">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:srcCompat="@drawable/ic_arrow"
                android:id="@+id/backButton"
                android:tint="@color/search_back"
                android:scaleX="1.2"
                android:scaleY="1.2"
                android:padding="10dp"
                android:contentDescription="@string/back_button" />

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_marginStart="20dp"
                android:elevation="0dp"
                android:layout_marginEnd="20dp"
                android:layout_height="wrap_content">

                <AutoCompleteTextView
                    style="@style/Suggestions"
                    android:paddingStart="20dp"
                    android:paddingTop="8dp"
                    android:paddingEnd="40dp"
                    android:paddingBottom="8dp"
                    android:id="@+id/searchEditText"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:autofillHints="One Piece"
                    android:background="@drawable/search_edit_text_background"
                    android:duplicateParentState="false"
                    android:hint="@string/search"
                    android:imeOptions="actionSearch"
                    android:inputType="textCapWords"
                    android:textSize="18sp" />

                <TextView
                    android:id="@+id/searchEditTextClear"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="end|center_vertical"
                    android:layout_marginEnd="@dimen/suggestions_spacing"
                    android:background="@drawable/ic_delete"
                    app:srcCompat="@drawable/ic_delete" />

            </FrameLayout>
        </LinearLayout>

    </androidx.cardview.widget.CardView>


    <androidx.recyclerview.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/searchRecyclerView"
        app:layout_constraintTop_toBottomOf="@id/cardView"
        app:layout_constraintBottom_toBottomOf="parent"
        android:paddingStart="15dp"
        android:paddingEnd="10dp"
        android:paddingTop="20dp"
        android:paddingBottom="20dp"
        android:clipToPadding="false"
        />

    <include layout="@layout/loading" />

</androidx.constraintlayout.widget.ConstraintLayout>